import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

import javax.swing.JOptionPane;


public class Server {

	public static void main(String[] args) {

		ServerSocket server;
		Socket socket;
		InputStream leitor;
		BufferedReader buffer;
		
		try {
			server = new ServerSocket(606);
			
			System.out.println("Ouvindo na 606...");
			
			socket = server.accept();
			leitor = socket.getInputStream();
			buffer = new BufferedReader(new InputStreamReader(leitor));
			
			System.out.println(buffer.readLine());
			
			buffer.close();
			socket.close();
			server.close();
			
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}

}
